package com.ce.workflow.work.logic.search;

import java.sql.ResultSet;
import java.sql.SQLException;
import com.ce.workflow.work.view.WorkflowWorkView;
import com.ce.framework.datamaintain.logic.ISQLMapper;
import com.ce.framework.datamaintain.logic.SQLSearchCondition;
import com.ce.framework.exception.AppException;
import com.ce.framework.util.StringUtil;

/**
* 郑州嫦娥软件有限公司 版权所有 2007
* 创建人：　孙吉涛
* 创建日期：2014-03-24
* 创建时间：17:59:52
* 功能描述：工作流程表 [T_WORKFLOW_WORK]条件过滤类
* ==============================================
* 修改历史
* 修改人		修改时间		修改原因
*
* ==============================================
*/
public class WorkflowWorkSearchCondition  extends SQLSearchCondition
	implements ISQLMapper
{

	public String getSearchSql() throws AppException {
		
		StringBuffer sql = new StringBuffer("select * from T_WORKFLOW_WORK t where t.VC_DEL$FLAG = 0");
		/*=========自行修改该处代码================
		//实现排序的代码
		sql.append(" "+super.getOrderBy());
		======================================*/
		return sql.toString();
	}
	
	public Object fromSQLQuery(ResultSet rs, int num) {
		WorkflowWorkView view = new WorkflowWorkView();
		try {

			view.setVcId(rs.getString("VC_ID"));
			view.setVcTableName(rs.getString("VC_TABLE_NAME"));
			view.setVcRecordId(rs.getString("VC_RECORD_ID"));
			view.setVcStatus(rs.getString("VC_STATUS"));
			view.setDtStartDate(rs.getDate("DT_START_DATE"));
			view.setDtEndDate(rs.getDate("DT_END_DATE"));
			view.setVcDesc(rs.getString("VC_DESC"));
			view.setVcOrgId(rs.getString("VC_ORG_ID"));
			view.setVcOrgName(rs.getString("VC_ORG_NAME"));
			view.setVcPersonId(rs.getString("VC_PERSON_ID"));
			view.setVcPersonName(rs.getString("VC_PERSON_NAME"));
			view.setVcHandleOrgid(rs.getString("VC_HANDLE_ORGID"));
			view.setVcHandleOrgname(rs.getString("VC_HANDLE_ORGNAME"));
			view.setVcHandlePersonId(rs.getString("VC_HANDLE_PERSON_ID"));
			view.setVcHandlePersonName(rs.getString("VC_HANDLE_PERSON_NAME"));
			view.setVcHandleInfo(rs.getString("VC_HANDLE_INFO"));
			view.setVcHandleDate(rs.getDate("VC_HANDLE_DATE"));
			view.setVcHandleOrgids(rs.getString("VC_HANDLE_ORGIDS"));
			view.setVcDelFlag(rs.getString("VC_DEL_FLAG"));			

		} catch (SQLException e) {
			
			e.printStackTrace();
		}
		return view;
	}
	
	public ISQLMapper getSQLMapper() {
		
		return this;
	}
}